﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Commerce.Base.Ubl.DataType
{
    /// <summary>
    /// A set of finite-length sequences of binary octets
    /// </summary>
    public class Binary
    {
        private System.Byte[] value;
        private Text format;
        private Code mimeCode;
        private Code encodingCode;
        private Code characterSetCode;
        private Text filename;

        /// <summary>
        /// The binary value.
        /// </summary>
        public System.Byte[] Value
        {
            get { return this.value; }
            set { this.value = value; }
        }

        /// <summary>
        /// The format of the binary content.
        /// </summary>
        public Text Format
        {
            get { return format; }
            set { format = value; }
        }

        /// <summary>
        /// The mime type of the binary object.
        /// </summary>
        public Code MimeCode
        {
            get { return mimeCode; }
            set { mimeCode = value; }
        }
        
        /// <summary>
        /// Specifies the decoding algorithm of the binary object.
        /// </summary>
        public Code EncodingCode
        {
            get { return encodingCode; }
            set { encodingCode = value; }
        }

        /// <summary>
        /// The character set of the binary object if the mime type is text.
        /// </summary>
        public Code CharacterSetCode
        {
            get { return characterSetCode; }
            set { characterSetCode = value; }
        }

        /// <summary>
        /// The filename of the binary object
        /// </summary>
        public Text Filename
        {
            get { return filename; }
            set { filename = value; }
        }

        public Binary(System.Byte[] value, Code mimeCode)
        {
            this.value = value;
            this.mimeCode = mimeCode;
        }
    }
}
